/**
 * Copyright (C) 2013-2015
 *
 * @file   S_3_Function_doEvent.c
 *
 * @remark
 *
 */

#include "S_3_Function_doEvent.h"
#include "miio_user_api.h"
#include "iid.h"

void E_3_1_Feature_doEvent(uint32_t argument)
{

        // 初始化参数列表
        arguments_t * newArgs = arguments_new();
        if (newArgs == NULL)
        {
            MI_LOG_ERROR("arguments_new failed!\n");
            return;
        }

        // 参数个数
        newArgs->size = 1;

        // 第0个参数: Argument
        newArgs->arguments[0].piid = 5;
        newArgs->arguments[0].value = property_value_new_ulong(argument);

        // 发送消息到服务器
        if (miio_mesh_event_occurred(3, 1, newArgs) != 0)
        {
            MI_LOG_ERROR("send_event_occurred failed!\n");
        }
}

void E_3_2_Success_doEvent(uint32_t remindType)
{

        // 初始化参数列表
        arguments_t * newArgs = arguments_new();
        if (newArgs == NULL)
        {
            MI_LOG_ERROR("arguments_new failed!\n");
            return;
        }

        // 参数个数
        newArgs->size = 1;

        // 第0个参数: RemindType
        newArgs->arguments[0].piid = 7;
        newArgs->arguments[0].value = property_value_new_ulong(remindType);

        // 发送消息到服务器
        if (miio_mesh_event_occurred(3, 2, newArgs) != 0)
        {
            MI_LOG_ERROR("send_event_occurred failed!\n");
        }
}

